//
//  ProgressLableView.m
//  Koina
//
//  Created by welldone on 13-12-6.
//  Copyright (c) 2013年 net.koina. All rights reserved.
//

#import "ProgressLableView.h"

@interface ProgressLableView ()
@property (nonatomic,retain)UIProgressView *progressView;
@property (nonatomic,retain)UILabel *proLable;
@property(nonatomic,assign) float bufPro;
@end



@implementation ProgressLableView
@synthesize progressView,proLable;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(10,frame.size.height/2-68, frame.size.width-10-10, 20.0f)];
        [progressView setProgressTintColor:[UIColor orangeColor]];
        [progressView setProgressViewStyle: UIProgressViewStyleDefault];
        [progressView setProgress:0.0f];
        [self addSubview:progressView];
        
        
        proLable = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.width/2-20, progressView.frame.origin.y-30, 80, 30)];
        [proLable setFont:[UIFont systemFontOfSize:13.0f]];
        [proLable setBackgroundColor:[UIColor clearColor]];
        [proLable setTextColor:[UIColor colorWithRed:(float)0x44/(float)0xff green:(float)0x44/(float)0xff blue:(float)0x44/(float)0xff alpha:1]];
        [self addSubview:proLable];
        
    }
    return self;
}




-(void)setProgess:(float)pro animation:(Boolean)animation{
    
    _bufPro = pro;
    
    [progressView setProgress:pro animated:animation];
    
    [proLable setText:[NSString stringWithFormat:@"%.0f%@",pro*100,@"%"]];
}

-(float)getCurrProgress{
    return _bufPro;
}


@end
